<template>
	<view>
		<view class="search">
			<view class="search-content">
				<u-search bg-color="white" v-model="value" :show-action="false" :placeholder="placeholder" :focus="true"></u-search>
				<view class="btn-search" @click="handleSearch">搜索</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		props: {
			placeholder: {
				type: String,
				default: '请输入内容'
			},
			model: ""
		},
		data() {
			return {
				value: ''
			}
		},
		watch: {
			value(val) {
				this.$emit('search', val)
			},
		},
		mounted() {
			
		},
		methods: {
			handleSearch() {
				this.$emit('search', this.value)
			}
		}
	};
</script>

<style lang="scss" scoped>
.search {
	height: 50px;
	display: flex;
	align-items: center;
}
.search-content {
	display: flex;
	align-items: center;
	flex: 1;
	border-radius: 45px;
	background-color: white;
}

.btn-search {
	border-radius: 15px;
	background: linear-gradient(90deg, #9CC5FF 0%, #3283FF 100%);
	padding: 3px 15px;
	margin: 12rpx 16rpx;
	color: white;
	// width: 60px;
}
</style>